package com.desire.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: littleDesire
 * @Date: 2022-06-14 16:40
 * @Version: 1.0
 */
@RestController
@RefreshScope
public class ConfigController {

    @Value("${dev.username}")
    String username;
    @Value("${dev.password}")
    String password;

    @GetMapping("/config")
    public Map<String, Object> map() {
        Map<String, Object> map = new HashMap<>();
        map.put("username", username);
        map.put("password", password);
        return map;
    }
}
